#if defined(__CYGWIN__)
#else
#    include <cstddef>
#    include <cstdint>
#    include <memory>
#    include <sched.h>
struct msghdr;
struct addrinfo;
namespace xncc {
namespace foundation {
    class XnccAddress;
    class IcmpHelper
    {
      public:
        IcmpHelper(std::shared_ptr<XnccAddress> addr);
        void ping();

      private:
        void             sendV6();
        void             sendV4();
        void             procV6(char* ptr, uint64_t len, struct msghdr* msg, struct timeval* tvrecv);
        void             procV4(char* ptr, uint64_t len, struct timeval* tvrecv);
        uint16_t         in_cksum(uint16_t* addr, int len);
        void             initV6();
        void             recvMsg();
        void             tv_sub(struct timeval* out, struct timeval* in);
        struct addrinfo* hostServ(const char* host, const char* serv, int family, int socktype);

      private:
        std::shared_ptr<XnccAddress> addr_;
        std::shared_ptr<XnccAddress> rspAddr_;
        const pid_t                  pid_;
        uint16_t                     nsent_;
        int                          fd_;
        int                          icmpProtocol_;
        struct addrinfo*             ar_;
        static constexpr int         BUFSIZE = 1500;
    };

}  // namespace foundation
}  // namespace xncc
#endif